package com.spa.infrastructure.enums.dict.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import com.spa.infrastructure.enums.dict.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "orderOperStatus", desc = "订单操作状态")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum OrderOperStatusEnum implements IBaseEnum {
    $10(31, "已接单","已出发",1,0),
    $20(32, "已出发","已到达",2,0),
    $30(33, "已到达","开始服务",3,0),
    $40(34, "开始服务","服务完成",4,0),
    $50(35, "服务完成",null,5,0);

    private Integer code;
    private String desc;

    private String buttn;
    //排序
    private Integer sort;
    //状态  0 启用  1 不启用
    private Integer status;

    public static OrderOperStatusEnum byCode(int code) {
        for (OrderOperStatusEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }

}
